package com.newbingo.action;

import com.newbingo.dao.imple.IAgentDao;
import com.newbingo.dto.AgentDto;
import com.newbingo.dto.imple.IAgentDto;
import com.opensymphony.xwork2.ActionSupport;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;


/**
 * 跳转action
 * 
 * @author AzureWy
 * 
 */
public class ForwardAction extends ActionSupport {
	private IAgentDto agentDto;
	private String userName;
	private String pwd;

	private static final long serialVersionUID = 1L;

	@Override
	public String execute() throws Exception {
		HttpSession session = ServletActionContext.getRequest().getSession();
		AgentDto agent = agentDto.findByLogin(userName, pwd);
		session.setAttribute("user", agent);
		return SUCCESS;
	}

	public IAgentDto getAgentDto() {
		return agentDto;
	}

	public void setAgentDto(IAgentDto agentDto) {
		this.agentDto = agentDto;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

}
